apparmor: allow change_profile for nested container runtimes#942
Open
Mohataseem89 wants to merge 1 commit into
Open
apparmor: allow change_profile for nested container runtimes#942Mohataseem89 wants to merge 1 commit into
Mohataseem89 wants to merge 1 commit into
Conversation
mtrmac
reviewed
Jun 26, 2026
mtrmac
left a comment
Contributor
There was a problem hiding this comment.
https://github.com/podman-container-tools/container-libs/blob/main/CONTRIBUTING.md#sign-your-prs please, we can’t even really look at PRs with unclear copyright status.
When the podman socket is bind-mounted into a systemd/Quadlet-launched container and a Docker-compat client (docker compose, docker CLI) inside that container starts a new container, crun writes the AppArmor profile name to /proc/thread-self/attr/apparmor/exec. On kernel >= 6.17 this write fails with 'unable to assign security attribute' because the outer container's AppArmor profile does not permit change_profile. Signed-off-by: Mohataseem Khan <mohataseem89@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes: podman-container-tools/podman#28992"
On kernel 6.17, starting a container via the Docker-compat API
(docker compose / docker CLI pointed at the podman socket) from inside a
systemd/Quadlet-launched container fails with:
The outer container runs under
containers-default-*. When crun insidethat container tries to write an AppArmor profile name to
/proc/thread-self/attr/apparmor/execfor the child container, thekernel rejects it because
change_profileis not permitted by the outercontainer's profile.
Native
podman runfrom the host is unaffected (process is unconfined).podman --remoteis also unaffected. Only the compat API path frominside a confined systemd container triggers this.
Reported: podman-container-tools/podman#28992
Downstream: moghtech/komodo#1488
Fix
add
change_profile -> **,inside the>= 208096version guard,alongside the existing signal rules for crun/runc/podman. This gives
OCI runtimes running inside a container permission to assign AppArmor
profiles to their child processes.
Testing
reproduction:
--cgroups=split --sdnotify=conmonand the host's rootful podman socket bind-mounted.
docker run alpine echo hiagainst thesocket.
crun: unable to assign security attribute